{% extends 'TopxiaWebBundle::bootstrap-modal-layout.html.twig' %}

{% block title %}{{'填写TA的邀请码'|trans}}{% endblock %}

{% block body %}

<form id="write-invite-code" class="form-horizontal" action="{{path('write_invitecode')}}" method="post" >
  <div class="form-group">
    <div class="col-md-2 control-label"><label>{{'TA的邀请码'|trans}}</label></div>
    <div class="controls col-md-8">
      <input class="form-control" type="text" placeholder="{{'邀请码'|trans}}" name="inviteCode" value="{{ app.request.get('inviteCode') }}">
     {% if setting('invite.get_coupon_setting',1) == 1 %}
      <div class="help-block">{{'填写TA的邀请码，当您第一次消费后，TA会获得邀请奖励。'|trans}}</div>
     {% elseif setting('invite.get_coupon_setting',1) == 0 %}
      <div class="help-block">{{'填写TA的邀请码，TA会获得邀请奖励。'|trans}}</div>
     {% endif %} 
    </div>
  </div>
  <input type="hidden" name="_csrf_token" value="{{ csrf_token('site') }}">
</form>
<script>app.load('coin/invite-code')</script>
{% endblock %}

{% block footer %}
  <button id="create-btn" data-submiting-text="{{'正在提交'|trans}}" type="submit" class="btn btn-primary pull-right" data-toggle="form-submit" data-target="#write-invite-code" data-url="{{path('receive_coupon')}}">{{'提交'|trans}}</button>
{% endblock %}